
import { axios } from '@/utils/request'
// const baseURL = 'http://47.114.135.244:6060/'
// const baseURL = 'http://10.7.29.91:8080/'
// const baseURL = 'http://8.140.128.96:8833/'
const baseURL = 'http://localhost:8099/'

function myRequest(url, params){
  return axios({
    url: baseURL+url,
    method: 'post',
    data: params
  })
}
function getUUID() { 
    var d = new Date().getTime()
    if (window.performance && typeof window.performance.now === 'function') {
        d += performance.now() //use high-precision timer if available
    }
    var uuid = 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = (d + Math.random() * 16) % 16 | 0
        d = Math.floor(d / 16)
        return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16)
    })
    return uuid
}
export default {
	install : function(Vue){
		Vue.prototype.myRequest = myRequest
    Vue.prototype.getUUID = getUUID
    Vue.prototype.baseURL = baseURL
	},
  baseURL
}
